cmake_minimum_required(VERSION 3.16)
project(Profiler LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR}
    COMPONENTS
        Core
        Gui
        Widgets
        QuickWidgets
)

set(PROJECT_SOURCES
"main.cpp"
"Application.qrc"
)

set(view_source
"view/OSWindow.h"
"view/OSWindow.cpp"
"view/OSWindow.ui"

"view/Note.h"
"view/Note.cpp"
"view/Note.ui"

"view/BaseDlg.h"
"view/BaseDlg.cpp"
"view/BaseDlg.ui"

"view/Profiler.ui"
"view/Profiler.h"
"view/Profiler.cpp"

"view/BaseWindow.h"
"view/BaseWindow.cpp"

)

set(logic_source
"logic/RenderThread.h"
"logic/RenderThread.cpp"
"logic/Scene.h"
"logic/Scene.cpp"
)

set(control_source
"control/RenderWindow.h"
"control/RenderWindow.cpp"
)

set(model_source
"model/Serializer.h"
)

add_executable(Profiler ${PROJECT_SOURCES} ${view_source} ${control_source} ${logic_source} ${model_source})

#set_target_properties(Profiler
#    PROPERTIES
#        WIN32_EXECUTABLE TRUE
#)

set_target_properties(Profiler
    PROPERTIES
        AUTORCC ON
        AUTOMOC ON
        AUTOUIC ON
)

target_link_libraries(Profiler
    PUBLIC
        Qt::Core
        Qt::Gui
        Qt::Widgets
        Qt6::QuickWidgets
        utility
        dx12
        d3d12
        dxgi
        glfw
)

target_link_directories(Profiler PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
